
using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.Contracts;

namespace Domain
{
    /// <summary>
    /// 物料主表
    /// </summary>
    public class MaterialReplenishment
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Key]
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 单据编码
        /// </summary>
        public string? DocCode { get; set; } = string.Empty;

        /// <summary>
        /// 业务类型
        /// </summary>
        public string? BizType { get; set; } = string.Empty;

        /// <summary>
        /// 计划单号
        /// </summary>
        public string? PlanNo { get; set; } = string.Empty;

        /// <summary>
        /// 单据日期
        /// </summary>
        public string? DocDate { get; set; } = string.Empty;

        /// <summary>
        /// 操作员
        /// </summary>
        public string? Operator { get; set; } = string.Empty;

        /// <summary>
        /// 销售单号(可选)
        /// </summary>
        public string? SalesNo { get; set; }

        /// <summary>
        /// 物料名称(可选)
        /// </summary>
        public string? MaterialName { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string? DocStatus { get; set; } = string.Empty;

        /// <summary>
        /// 审核员(可选)
        /// </summary>
        public string? Auditor { get; set; }

        /// <summary>
        /// 订单交期(可选)
        /// </summary>
        public string? DeliveryDate { get; set; }

        /// <summary>
        /// 计量单位(可选)
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BizStatus { get; set; } = string.Empty;

        /// <summary>
        /// 生产数量
        /// </summary>
        public int? ProductionQty { get; set; }

        /// <summary>
        /// 备注信息(可选)
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedAt { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(MaterialDetail.UpId))]
        public List<MaterialDetail> MaterialDetails { get; set; } = new List<MaterialDetail>();
    }
}
